<?php
$cid        = gpc_getStringArray('cid');
$name       = "";

if(count($cid)==0)
{
    $cid[0]=$id;
}

foreach($cid as $id)
{

    //---------------Lay thong tin ve location sap xoa
    $sql_select = "SELECT cName,iParentId FROM tblhotel WHERE iId = '$id'";
    $rs=$dbsql->query($sql_select);
    if($result = $dbsql->fetch_array($rs))
    {
    	$name           .= $result["cName"];
        $idparent       = $result['iParentId'];
    }

    $sql_delete = "DELETE FROM tblhotel WHERE iId ='$id'";
    $dbsql->query($sql_delete);

    //delete photos if exists
    $sql_delete = "DELETE FROM tblgallery WHERE iParentId ='$id' and cType='hotel'";
    $dbsql->query($sql_delete);

    //delete map if exists:
    $sql_delete = "delete from tblmap where iParentId   = '$id' and cType = 'hotel'";
    $dbsql->query($sql_delete);
}


Insert_Tracking(" Del Hotel $name");
$pagetr = empty($pagetr) ? "id=$idparent" : $pagetr;
page_transfer("Delete Hotel Success",$pagetr);
exit();
?>